//<![CDATA[
// Emoticon bar before comment-form
// www.bloggerspice.com
$(function() {
    $(putEmoAbove)
      .before('<div style="text-align:center" class="BSemoWrap"> :khoc: ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :&gt;) (o) [-( :-? (p) :-s (m) 8-) :-t   <br/><b>Click vào icon để lấy code</b><br/>Copy code vào bài viết để nhận được icon tương ứng.</div>');
    var emo = function(emo, imgRep, BSemoKey) {
        $(emoRange)
            .each(function() {
            $(this)
                .html($(this)
                .html()
                .replace(/<br>:/g, "<br> :")
                .replace(/<br>;/g, "<br> ;")
                .replace(/<br>=/g, "<br> =")
                .replace(/<br>\^/g, "<br> ^")
                .replace(emo, " <img style='max-height:50px' src='" + imgRep + "' class='emo delayLoad' alt='" + BSemoKey + "' />"));
        });
    };
    emo(/\s:\fight:\)+/g, "http://lh5.googleusercontent.com/-DMLQQPbZ9-0/UEW-pLnUIHI/AAAAAAAABIs/m3nn2wPUiQg/s50/01.gif", ":fight:");
    emo(/\s;\(\(+/g, "http://lh4.googleusercontent.com/-BUTTBDddZ9E/UEW-rpOPyhI/AAAAAAAABJQ/mSFEkb-00-8/s50/05.gif", ":3cham:");
    emo(/\s:\khoc:+/g, "http://lh6.googleusercontent.com/-wd7GREFvijg/UEW-tpBNmrI/AAAAAAAABJ0/JlchwRF8BAM/s50/09.gif", ":khoc:");
    emo(/\s:-\)+/g, "http://lh3.googleusercontent.com/-FPcv3JDEjW8/UEW-sHboFwI/AAAAAAAABJc/9yu2zYNtxK4/s50/06.gif", ":domat:");
    emo(/\s=\)\)+/g, "http://lh5.googleusercontent.com/-KBilUYfZkO0/UEW-7y0P71I/AAAAAAAABMk/zQDPx1anzC0/s50/15.gif", ":smile:");
    emo(/\s;\(+/g, "http://lh4.googleusercontent.com/-KWAALsslGCk/UEW_GGJBQ3I/AAAAAAAABOs/YP-ljygbu_Q/s50/25.gif", ":setdanh:");
    emo(/\s;-\(+/g, "http://lh4.googleusercontent.com/-Q8booUuh4Cg/UEW_pqe4n_I/AAAAAAAABUA/xgxfaVUK14c/s80/haoxiao.gif", ":lol:");
    emo(/\s:d/ig, "http://lh4.googleusercontent.com/-k9cO5blzcGc/UEW-8Od5cGI/AAAAAAAABMs/mOySeuiE8WQ/s50/16.gif", ":chanh:");
    emo(/\s:-d/ig, "http://lh4.googleusercontent.com/-E7VvwAbhxLY/UEW-9CXfJ9I/AAAAAAAABM0/a2nleXCoh6I/s50/17.gif", ":bb:");
    emo(/\s@-\)+/g, "http://lh3.googleusercontent.com/-uuC3cq2mqVo/UEW_CgUuV6I/AAAAAAAABOE/3woC70vqT0E/s50/22.gif", ":kheu:");
    emo(/\s:tuc:/ig, "http://lh4.googleusercontent.com/-ezPqBJe7if0/UEW_FXZm3LI/AAAAAAAABOk/yhT3tMaigFI/s50/26.gif", ":tuc:");
    emo(/\s:o/ig, "http://lh3.googleusercontent.com/-61xaOi02l_k/UEW-qfNvlBI/AAAAAAAABI8/6yWEoLBAkfs/s50/02.gif", ":khoc2:");
    emo(/\s:&gt;\)+/g, "http://lh5.googleusercontent.com/-Ifv7hGV_vrc/UEW-qgR-oUI/AAAAAAAABJE/nzjgqZxqVd4/s50/03.gif", ":choang:");
    emo(/\s\(o\)+/ig, "http://lh3.googleusercontent.com/-WtJPZ7Ii_Ek/UEW-62S5nCI/AAAAAAAABMM/vTcuXzaya9Y/s50/14+%281%29.gif", ":chet:");
    emo(/\s\[-\(+/g, "http://lh5.googleusercontent.com/-QNFyUVH3F1k/UEW_s_MmNII/AAAAAAAABU8/CkMu1rLK_Ew/s60/sm-03.gif", ":ngoaymui:");
    emo(/\s:-\?/g, "http://a.deviantart.net/avatars/d/r/dragondrink.gif?1", ":phun:");
    emo(/\s\(p\)+/ig, "http://a.deviantart.net/avatars/h/a/hakaseshockniplz.gif?1", ":xanhmat:");
    emo(/\s:-s/ig, "http://a.deviantart.net/avatars/y/u/yuukoshockniplz.gif?1", ":giatminh:");
    emo(/\s\(m\)+/ig, "http://www.cute-factor.com/images/smilies/onion_custom/th_0v.gif", ":cuoilon:");
    emo(/\s:phon\:+/ig, "http://a.deviantart.net/avatars/s/o/sobeautifulplz.gif?1", ":phon:");
    emo(/\s:-t/ig, "http://www.cute-factor.com/images/smilies/onion_custom/th_0suit.gif", ":quat:");
   
// Show alert one times!
    $('div.BSemoWrap')
        .one("click", function() {
        if (emoMessage) {
            alert(emoMessage);
        }
    });
    // Click to show the code!
       $('.emo')
        .css('cursor', 'pointer')
        .live("click", function(e) {
        $('.BSemoKey')
            .remove();
        $(this)
            .after('<input class="BSemoKey" type="text" size="' + this.alt.length + '" value=" ' + this.alt + '" />');
$('.BSemoKey')
            .trigger("select");
e.stopPropagation();
    });
    $('.BSemoKey')
        .live("click", function() {
        $(this)
            .focus()
            .select();
    });
});
//]]>